module render.imagerender;

import render.abstractrenderer;
import canvas.abstractcanvas;
import utils.vector2;
import utils.color;

public class ImageRenderer : AbstractRenderer {
    private AbstractCanvas mImage;

    public void image(AbstractCanvas aimage) {
        mImage = aimage;
    }

    public AbstractCanvas image() {
        return mImage;
    }

    public void initRender(Vector2f pixelSize, Vector2f validFrom,
        Vector2f validTo)
    {
    }

    public Vector2f renderSize(float outAr) {
        return Vector2f.fromInt(mImage.size);
    }

    public RGBColor render(Vector2f pos) {
        RGBColor ret;
        mImage.getPixelColor(Vector2i.fromFloat(pos), ret);
        return ret;
    }
}
